<h1>New timeline</h1>

<% form_for(@timeline ) do |f| %>
  <% if f.error_messages.length > 0 -%>
      <div class="errors"><%= f.error_messages %></div>
     
 <% end -%>
  



                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" >
                                    <label for="title">Title:</label>
                                </td>
                                <td valign="top" class="<%= @timeline.errors.invalid?(:title)? "errors" : "input" %>">
                                    <%= f.text_field :title %>

                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="description">Description:</label>
                                </td>
                                <td valign="top"  class="<%= @timeline.errors.invalid?(:title)? "errors" : "input" %>">
                                      <%= f.text_area :description %>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type">Type:</label>
                                </td>
                                <td valign="top" >
                                     <%=   f.select :unit_type,  Timeline::TYPES   %>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type">Detail Unit:</label>
                                </td>
                                <td valign="top"  >
                                     <%=   f.select :detail_unit,  Timeline::UNITS,  :prompt => "Select the minor unit"   %>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="title">Detail Pixels:</label>
                                </td>
                                <td valign="top"  >
                                    <%= f.text_field :detail_pixels %>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type">Overview Unit:</label>
                                </td>
                                <td valign="top"  >
                                 
                                  <%=   f.select :overview_unit,  Timeline::UNITS,  :prompt => "Select a major unit"   %>

                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="title">Overview Pixels:</label>
                                </td>
                                <td valign="top" >
                                    <%= f.text_field :overview_pixels %>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button">
                        <input class="save" type="submit" value="Create"/>
                    </span>
                </div>




<% end %>

      <br>

<%= link_to 'Back', timelines_path %>

      <%= link_to "HTML view" , timelines_url(facebook_session_parameters.merge(:canvas=>false))%>